<!--

/*
* Copyright (C) 2005-2013 University of Sydney
*
* Licensed under the GNU License, Version 3.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.gnu.org/licenses/gpl-3.0.txt
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/

/**
* editSysIdentification.html, T1000 template for editing the system identification record which provides core settigns for the database
*
* @author      Tom Murtagh
* @author      Kim Jackson
* @author      Ian Johnson   <ian.johnson@sydney.edu.au>
* @author      Artem Osmakov   <artem.osmakov@sydney.edu.au>
* @copyright   (C) 2005-2013 University of Sydney
* @link        http://Sydney.edu.au/Heurist
* @version     3.1.0
* @license     http://www.gnu.org/licenses/gpl-3.0.txt GNU License 3.0
* @package     Heurist academic knowledge management system
* @subpackage  !!!subpackagename for file such as Administration, Search, Edit, Application, Library
*/

-->

<html>
    <head>
        <title>Database Properties</title>
        <meta http-equiv="content-type" content="text/html; charset=utf-8">
        <link rel="stylesheet" type="text/css" href="../../../common/css/global.css">
        <link rel="stylesheet" type="text/css" href="../../../common/css/edit.css">
        <link rel="stylesheet" type="text/css" href="../../../common/css/admin.css">
    </head>

    <body class="popup" onload="showMessage()">
        <script type="text/javascript" src="../../../common/js/utilsUI.js"></script>
        <script>
            // quite weird way - since it is not possibel (or unknown) how to treat t1000 in case of error
            function showMessage(){
                if(document.getElementById('divErrors').innerHTML=="" && top.HEURIST.util.getUrlParameter('was', this.location.search)){
                    top.HEURIST.util.popupTinyElement(this, document.getElementById('divMessage'));
                    setTimeout(function(){
                        top.HEURIST.util.closePopupLast();
                        }, 1000);
                }
            }
        </script>

        <div class="banner"><h2>Database Properties</h2>
            <!--{PageHeader} -->
        </div>

        <div id="page-inner">

            <div id="divErrors">[errors]</div>

            [foreach SYSID sys]

            <form action="editSysIdentification.php?was=1&amp;db=[dbname!]" method="post">

                [update required SYSID sysid_update]

                <h3>General information</h3>

                <div class="input-row">
                    <div class="input-header-cell">Heurist registration number (0 = not registered) and database version</div>
                    <div class="input-cell">Registration number <b>[sys_dbRegisteredID]</b>&nbsp;&nbsp;&nbsp;
                        Database format version <b>[sys_dbVersion].[sys_dbSubVersion].[sys_dbSubSubVersion]</b></div>
                </div>
                <div class="input-row"><div class="input-header-cell">Display name (more informative than database name at top of page) * </div>
                    <div class="input-header-cell"> [textbox required : sys_dbName : : size=40] </div></div>
                <div class="input-row"><div class="input-header-cell">Database rights statement (or URL to rights statement) </div>
                    <div class="input-header-cell"> [textbox : sys_dbRights : : size=100]</div></div>
                <div class="input-row"><div class="input-header-cell">Name/institution of owner (or URL to owner information)</div>
                    <div class="input-header-cell">[textbox : sys_dbOwner : : size=100]         </div></div>
                <div class="input-row"><div class="input-header-cell">Description of the database/content up to 1Kb (may reference a URL)</div>
                    <div class="input-header-cell">[textarea : sys_dbDescription : : rows="8" cols=100 ] </div></div>


                <!--
                <div class="input-row"><div class="input-header-cell">[sys_SyncDefsWithDB] </div>
                <div class="input-header-cell"></div></div>
                <div class="input-row"><div class="input-header-cell">[sys_AutoIncludeFieldSetIDs] </div>
                <div class="input-header-cell"></div></div>
                -->
                <h3>Behaviours</h3>


                <!-- This has caused lots of trouble - it is not really necessary because system remembers user's choice.
                If we do re-enable it, it shoudl be a pulldown and should be changed to OVERRIDE the user's choice -->
                <div class="input-row"  style="visibility:hidden">
                    <div class="input-header-cell">Owner group for new records ('0' indicates 'everyone') </div>
                    <div class="input-cell" > [textbox : sys_NewRecOwnerGrpID : : size=3] 0 indicates the 'all users' pseudo-group </div>
                </div>
                <!-- This should really be 'required' but T1000 treats 0 as False, so it is rejected -->

                <div class="input-row">
                    <div class="input-header-cell">Default access outside owner group on bulk imported records (only owners can edit)</div>
                    <div class="input-cell">[dropdown : sys_NewRecAccess : Default access outside owner group when records are imported : enum( "hidden", "viewable", "pending", "public")]</div>
                </div>


                <!-- PROBLEM: If these checkboxes are not checked, they set the field to missing, but these are NOT NULL fields,
                              and although defaulted to 0 at the start, they do not get set by T1000 -->

                <div class="input-row">
                    <div class="input-header-cell">Set 'public' to 'pending' when record edited (use to stage record edits)</div>
                    <div class="input-cell">[checkbox : sys_SetPublicToPendingOnEdit : : size=1] </div>
                </div>

                <!-- Sep 2011: bug - even the owners couldn't see the records -->
                <div class="input-row">
                <div class="input-header-cell">Restrict database access to members of the owners group  </div>
                <div class="input-cell">[checkbox : sys_RestrictAccessToOwnerGroup  : : size=20]</div>
                </div>


                <div class="input-row">
                    <div class="input-header-cell">Allow online registration as user (confirmed by Database Owner)  </div>
                    <div class="input-cell">[checkbox : sys_AllowRegistration : : size=20] </div>
                </div>

                <div class="input-row">
                    <div class="input-header-cell">Carry out nightly URL validation (can overload targets)  </div>
                    <div class="input-cell">[checkbox : sys_URLCheckFlag  : : size=20]</div>
                </div>

                [end-update]


                <p><span class="red">[errors]</span></p>
                <input type="submit" value="save">
            </form>

            [end-foreach]
        </div>

        <div id="divMessage" style="display:none;width:180px;height:80px;text-align:center;">
            <div id="divMessage-text" style="color:black;font-weight:bold;margin:10px;">Properties saved</div>
        </div>

    </body>
</html>



